#ifndef PIDCONTROL_H
#define PIDCONTROL_H
#include <stdint.h>

typedef struct PID {
    float  Kp;
    float  Ki;
    float  Kd;

    float  LastError;
    float  Error;
    float  SumError;

    float  output;
} tPID;

void Read_Encoder(int *button);
void Load(int moto1,int moto2);
void PID_Init(void);
float PID_Fan_Calc(tPID *PIDX,float Yaw_Bias);
void Fan_Control(int pwm);
void Position_Control(int *DuoJi_Position);
void LightBeef(uint8_t flag);
int NiHe_Model_Final(int Duoji_angle,int Sail_angle);
void Limit(int *BeLimited,int Range);
void PlaySimpleMusic(void);

extern int button;
extern tPID Fan_PID;

#endif //PIDCONTROL_H
